import {
	data
} from "../../uni_modules/uview-ui/libs/mixin/mixin"

export default {
	namespaced: true,
	state: {
		// 管理员的标识
		roleKey:'',
		// 从本地读取token
		token: '',
		userInfo: '',
		URL:'https://www.anhuimiller.com:441'
	},
	mutations: {
		// 设置token
		setToken(state, data) {
			state.token = data
			// 设置本地存储
			uni.setStorageSync('token', data)
		},
		// 设置用户资料
		setUserInfo(state, data) {
			state.userInfo = data
			// uni.setStorageSync('userInfo', data)
		},
		// 设置用户资料
		setroleKey(state, data) {
			state.roleKey = data
			uni.setStorageSync('roleKey', data)
		}
	},
}